package com.example.demo.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.common.Result;
import com.example.demo.entity.UserInfo;
import com.example.demo.service.UserInfoService;
import com.example.demo.utils.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 第五小组
 * @since 2021-08-04
 */
@RestController
@RequestMapping("/bilibili")
public class UserInfoController {

    @Autowired
    UserInfoService userInfoService;

    @GetMapping("/uploader")
    public Result uploader(@RequestParam("uid") String uid, HttpServletResponse response){
        Util.exec("\\脚本\\user_info.py ",uid);
        return Result.succ(userInfoService.getOne(new QueryWrapper<UserInfo>().eq("uid",uid)));
    }
}
